﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Administrator/MasterPage.master" AutoEventWireup="false" CodeFile="mSanctionList.aspx.vb" Inherits="Administrator_mSanctionList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript">
    function ConfirmDel() {
        if (confirm("ยืนยันการลบข้อมูล ?") == true) {
            //$("input[id$=hdfUpload0]").click();
            document.getElementById("<%=hdfButton.ClientID%>").click();
        }
    }

    $(document).ready(function () {
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        $('.number').keypress(function (event) {

            if (event.which < 48 || event.which > 59) {
                event.preventDefault();
            } // prevent if not number/dot

            if (event.which == 48 && $(this).val().length == 0) {
                event.preventDefault();
            } // prevent if already dot

            if ($(this).val().length == 2) {

                if ($(this).val().charAt(0) != '1') {
                    event.preventDefault();
                } else {
                    if ($(this).val().charAt(1) != '0')
                        event.preventDefault();
                    else {
                        if (event.which > 48)
                            event.preventDefault();
                    }
                }
            } // prevent if over 100

            if ($(this).val().length == 3) {
                event.preventDefault();
            } // prevent if over 3 character

        });

        function EndRequestHandler(sender, args) {
            $('.number').keypress(function (event) {

                if (event.which < 48 || event.which > 59) {
                    event.preventDefault();
                } // prevent if not number/dot

                if (event.which == 48 && $(this).val().length == 0) {
                    event.preventDefault();
                } // prevent if already dot

                if ($(this).val().length == 2) {

                    if ($(this).val().charAt(0) != '1') {
                        event.preventDefault();
                    } else {
                        if ($(this).val().charAt(1) != '0')
                            event.preventDefault();
                        else {
                            if (event.which > 48)
                                event.preventDefault();
                        }
                    }
                } // prevent if over 100

                if ($(this).val().length == 3) {
                    event.preventDefault();
                } // prevent if over 3 character

            });
        }
    });
    
</script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width:100%;">
                <tr>
                    <td align="right" >
                        <asp:Label ID="lblListTypeCode" runat="server" CssClass="control">Watchlist Code :</asp:Label>
                    </td>
                    <td align="left" style="height: 26px">
                        <asp:TextBox ID="txtListTypeCode" runat="server" CssClass="control" 
                            Height="20px" Width="188px" AutoCompleteType="Disabled" MaxLength="20"></asp:TextBox>
                    </td>
                    
                    <td align="left" style="height: 26px; text-align: right; ">
                        <asp:Label ID="lblListTypeName" runat="server" CssClass="control">Watchlist Detail :</asp:Label>
                    </td>
                    <td align="left" style="height: 26px" >
                        <asp:TextBox ID="txtListTypeName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="100" Width="343px"  
                            ></asp:TextBox>
                    </td>
                    
                </tr>
                <tr>
                    <td align="right" valign="top" >
                        <asp:Label ID="lblFileName" runat="server" CssClass="control">ชื่อไฟล์ :</asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtFileName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="100" Width="187px"></asp:TextBox>
                    </td>
                  
                    <td align="left" style="text-align: right" valign="top"  >
                        <asp:Label ID="lblRiskLevel" runat="server" CssClass="control">Risk Factor Score :</asp:Label>
                    </td>
                    <td align="left" style="width: 333px">
                        <asp:TextBox ID="txtRiskLevel" runat="server" AutoCompleteType="Disabled" 
                            CssClass="number" Height="20px" MaxLength="100" Width="69px"></asp:TextBox>
                        <br />
                    </td>
                
                </tr>
                <tr id="trhide" runat="server">
                    <td align="right" valign="top">
                        <asp:Label ID="lblBatchJob" runat="server" CssClass="control">ชื่อไฟล์ Batch :</asp:Label>
                    </td>
                    <td align="left" valign="top">
                        <asp:TextBox ID="txtBatchJob" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="100" Width="226px"></asp:TextBox>
                    </td>
                    <td align="left" style="text-align: right" valign="top">
                        <asp:Label ID="lblBatchTestJob" runat="server" CssClass="control">ชื่อไฟล์ Batch Test :</asp:Label>
                    </td>
                    <td align="left" style="width: 333px">
                        <asp:TextBox ID="txtBatchTestJob" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="100" Width="226px"></asp:TextBox>
                    </td>
                   
                </tr>
                <tr >
                    <td align="right" width="150">
                        File Type :
                    </td>
                    <td align="left" style="height: 26px; ">
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>
                                <table style="width:100%;">
                                    <tr>
                                        <td style="width: 231px">
                                            <asp:DropDownList ID="ddlList" runat="server" CssClass="control" Height="25px" 
                                                Width="214px" AutoPostBack="True">
                                                <asp:ListItem Value="0">** กรุณาเลือกประเภทความเสี่ยง **</asp:ListItem>
                                                <asp:ListItem Value="1">CSV/ZIP</asp:ListItem>
                                                <asp:ListItem Value="2">XML</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
               
                    <td align="left" style="text-align: right; " colspan="2">
                        &nbsp;</td>
               
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;</td>
                    <td align="left" style="text-align: right">
                        &nbsp;</td>
                    <td align="left" colspan="2" style="text-align: right; ">
                      <asp:Button ID="hdfButton" runat="server"  style="display:none"
                            Width="0px"  Height="0px" />
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="search" 
                            Width="80px" />
                        <asp:Button ID="btnAdd" runat="server" CssClass="control" Text="Add" 
                            Width="80px" />
                        <asp:Button ID="btnModify" runat="server" CssClass="control" Text="Modify" 
                            Width="80px" />
                        <asp:Button ID="btnDelete" runat="server" CssClass="control" Text="Delete" 
                            Width="80px" />
                        <asp:Button ID="btnClear" runat="server" CssClass="control" Text="Clear" 
                            Width="80px" />
                        <asp:Button ID="btnPrint" runat="server" CssClass="control" Text="Print" 
                            Visible="False" Width="80px" />
                    </td>
                </tr>
            </table>
           <div align="center">

        <asp:Label ID="lblMsg" runat="server" CssClass="control" Font-Size="X-Large" 
                        ForeColor="Red" Height="30px" style="text-align: center" 
                   Font-Bold="True"></asp:Label>

            <asp:GridView ID="gvSanctionList" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" CellPadding="4" CssClass="control" 
                ForeColor="#333333" Width="100%" AllowPaging="True">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <FooterStyle BackColor="White" Font-Bold="True" ForeColor="#333333" />
                <RowStyle ForeColor="#333333" />
                <PagerSettings Mode="NumericFirstLast" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                    CssClass="cssPager" />
                <SelectedRowStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:CommandField ButtonType="Image" 
                        SelectImageUrl="~/img/icon/select_icon.gif" ShowSelectButton="True">
                    <ItemStyle Width="3%" />
                    </asp:CommandField>
                    <asp:BoundField DataField="ListTypeCode" HeaderText="Watchlist Code" ReadOnly="True" 
                        SortExpression="ListTypeCode">
                    <ItemStyle HorizontalAlign="Left" Width="130px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText = "File Type" >
                    <ItemTemplate >
                    <asp:Label ID ="lbFileType" runat="server" Text ='<%# iif(eval("FILETYPE")="1","CSV/ZIP","") &  iif(eval("FILETYPE")="2","XML","")%>'>
                    </asp:Label>
                    </ItemTemplate> 
                    </asp:TemplateField>
                    <asp:BoundField DataField="RiskLevel" HeaderText="Risk Factor Score">
                    <ItemStyle Width="120px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ListTypeName" HeaderText="Watchlist Detail" ReadOnly="True" 
                        SortExpression="ListTypeName">
                    <ItemStyle HorizontalAlign="Left" Width="180px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FileName" HeaderText="ชื่อไฟล์">
                    <ItemStyle HorizontalAlign="Left" Width="150px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="BatchJob" HeaderText="ชื่อไฟล์ Batch" Visible="false">
                    <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                     <asp:BoundField DataField="BatchTestJob" HeaderText="ชื่อไฟล์ Batch Test" Visible="false">
                    <ItemStyle HorizontalAlign="Left" />
                     </asp:BoundField>              
                  </Columns>
            </asp:GridView>
            </div>
            <div align="right">
                <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

